package cn.crsc.openlookeng.reposity;

import cn.crsc.openlookeng.adhoc.jdbc.EngineType;
import cn.crsc.openlookeng.annotation.Catalog;
import cn.crsc.openlookeng.annotation.Query;
import cn.crsc.openlookeng.annotation.Schema;
import cn.crsc.openlookeng.domain.Page;
import cn.crsc.openlookeng.domain.PageRequest;
import cn.crsc.openlookeng.domain.User;

import java.util.List;
import java.util.Map;

public interface UserRepo {

    @Query("SELECT id,name  FROM   hive.test_jdbc.test_presto")
    List<User> findAll();

    @Query("SELECT id,name  FROM   hive.test_jdbc.test_presto")
    Page<User> findAllByPage(PageRequest domain);


    @Query("SELECT id,name  FROM   hive.test_jdbc.test_presto where id = #{id}")
    User findOne(Long  id);


    @Catalog(EngineType.HIVE)
    @Schema("test_jdbc")
    @Query("SELECT count(*) as count_num from test_presto")
    Integer count();
}
